# Collect data from proc fs
def readListFile(fname):
  # collect data from devices
  metlist = []
  try:
    f = open(fname, 'r');
    lines = f.readlines();
  except Exception, e:
    logger.info("Read files error!")
    return [0, metlist]
  f.close()
  for line in lines:
    res = string.split(line)
    metlist.append([res[0], res[1]])
  return (1, metlist)

def readLineFile(fn):
  try:
    f = open(fn, 'r');
    line = f.readline()
    f.close()
  except Exception, e:
    logger.info("Read file %s error!" % fn)
    return ['0', '0', '0', '0']
  items = line.split()
  return [items[13], items[14], items[15], items[16]]
